package demo.java.springboot.mybatis.sys.po;

import java.util.ArrayList;
import java.util.List;

/**
 * 权限
 * @author Demon
 *
 */
public class Permission {

	/**
	 * ID
	 */
	private Integer id;
	
	/**
	 * 名称
	 */
	private String name;
	
	/**
	 * 类型  1 菜单  2 按钮
	 */
	private String type = "1";
	
	/**
	 * 图标
	 */
	private String icon;
	
	/**
	 * 编号，固定长度4位，每2为为一级，假设父菜单编号：0100，则子菜单：01XX
	 */
	private String no;
	
	/**
	 * 地址：点击菜单跳转url
	 */
	private String url;
	
	/**
	 * 描述
	 */
	private String description;

	/**
	 * 上级权限 多对一到权限
	 */
	private Permission parent;
	
	/**
	 * 下级权限 一对多到权限 放弃维护
	 */
	private List<Permission> children = new ArrayList<Permission>();

	public Permission() {
	}

	public Permission(Integer id, String name, String type, String icon, String no, String url) {
		super();
		this.id = id;
		this.name = name;
		this.type = type;
		this.icon = icon;
		this.no = no;
		this.url = url;
	}

	public Integer getId() {
		return id;
	}

	public void setId(Integer id) {
		this.id = id;
	}

	public String getName() {
		return name;
	}

	public void setName(String name) {
		this.name = name;
	}

	public String getType() {
		return type;
	}

	public void setType(String type) {
		this.type = type;
	}

	public String getIcon() {
		return icon;
	}

	public void setIcon(String icon) {
		this.icon = icon;
	}

	public String getNo() {
		return no;
	}

	public void setNo(String no) {
		this.no = no;
	}

	public String getUrl() {
		return url;
	}

	public void setUrl(String url) {
		this.url = url;
	}

	public String getDescription() {
		return description;
	}

	public void setDescription(String description) {
		this.description = description;
	}

	public Permission getParent() {
		return parent;
	}

	public void setParent(Permission parent) {
		this.parent = parent;
	}

	public List<Permission> getChildren() {
		return children;
	}

	public void setChildren(List<Permission> children) {
		this.children = children;
	}
	
	
}
